package com.iqiyi.pps.epg.core.model.record;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.HashMap;

/**
 * Created by karkarrotxu on 2018/4/11.
 */
@Entity
@Table(name = "record_task")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class RecordTask {
    private long  id;
    private long planId;
    private int taskStatus;
    private String taskStartTime;
    private String taskStopTime;
    private Timestamp updateTime;
    private Timestamp createTime;
    private int status = 1 ;

    //存放第三方用参数
    private HashMap<String, String> params = new HashMap<>();

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }


    @Column(name = "update_time", insertable = false, updatable = false)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "create_time"  , updatable = false)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Column(name = "plan_id")
    public long getPlanId() {
        return planId;
    }

    public void setPlanId(long planId) {
        this.planId = planId;
    }
    @Column(name = "task_status")
    public int getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(int taskStatus) {
        this.taskStatus = taskStatus;
    }
    @Column(name = "task_start_time")
    public String getTaskStartTime() {
        return taskStartTime;
    }

    public void setTaskStartTime(String taskStartTime) {
        this.taskStartTime = taskStartTime;
    }
    @Column(name = "task_stop_time")
    public String getTaskStopTime() {
        return taskStopTime;
    }

    public void setTaskStopTime(String taskStopTime) {
        this.taskStopTime = taskStopTime;
    }

    @Transient
    public HashMap<String, String> getParams() {
        return params;
    }

    public void setParams(HashMap<String, String> params) {
        this.params = params;
    }

    @Override
    public String toString() {
        return "RecordTask{" +
                "id=" + id +
                ", planId=" + planId +
                ", taskStatus=" + taskStatus +
                ", taskStartTime='" + taskStartTime + '\'' +
                ", taskStopTime='" + taskStopTime + '\'' +
                ", updateTime=" + updateTime +
                ", createTime=" + createTime +
                ", status=" + status +
                ", params=" + params +
                '}';
    }

}
